
/**
 * @param  {String} shopStaffPower  员工持有的权限信息(返回数据直接传入即可)
 * @param  {String} buttonPower     点击按钮的权限名称
 * @return {Boolean}                员工有权限返回true,没有权限返回false
 */
function shopStaffHavePower(shopStaffPower, buttonPower){
  if(shopStaffPower == undefined || shopStaffPower == null){
    return false;
  }
  let patt = ','+shopStaffPower.replace(',',',|,')+',';
  return patt.search(','+buttonPower+',') != -1;
}

// 方法外放
module.exports = {
  shopStaffHavePower: shopStaffHavePower
}
